﻿using System.Diagnostics;
using UnityEngine;

namespace SimpleCore.DebugTool
{
    public class TimePoint
    {
        [Conditional("PRINT_ERROR")]
        public void Record()
        {
            if (_time < 0)
            {
                _time = Time.realtimeSinceStartup;
                return;
            }
            
            LogHelper.LogError(Time.realtimeSinceStartup - _time);
            _time = Time.realtimeSinceStartup;
        }

        private double _time = -1;
    }
}